package com.weayer.remote;

import com.weayer.dto.*;
import com.weayer.response.DriverUserResponse;
import com.weayer.response.OrderDriverResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;

/**
 * @description: Service服务 - 司机 - 调用服务service-driver-user
 * @author: Weayer
 **/
@FeignClient("service-driver-user")
public interface ServiceDriverClient {

    @RequestMapping(method = RequestMethod.POST, value = "/user")
    public ResponseResult addUser(@RequestBody DriverUser driverUser);

    @RequestMapping(method = RequestMethod.PUT, value = "/user")
    public ResponseResult updateUser(@RequestBody DriverUser driverUser);

    @RequestMapping(method = RequestMethod.GET, value = "/check-driver/{driverPhone}")
    public ResponseResult<DriverUserResponse> checkDriver(@PathVariable("driverPhone") String driverPhone);

    @RequestMapping(method = RequestMethod.GET, value = "/car/{carId}")
    public ResponseResult<Car> getCarById(@PathVariable("carId") Long carId);

    @GetMapping("/get-available-driver/{carId}")
    public ResponseResult<OrderDriverResponse> getAvailableDriver(@PathVariable("carId") Long carId);

    @RequestMapping(method = RequestMethod.GET, value = "/driver-car-binding-relationship/get")
    public ResponseResult<DriverCarBindingRelationship> getDriverCarRelationShip(@RequestParam String driverPhone);

    @RequestMapping(method = RequestMethod.POST, value="/driver-user-work-status/change")
    public ResponseResult changeWorkStatus(@RequestBody DriverUserWorkStatus driverUserWorkStatus);
}
